Phase alignment in speech processing

ABSTRACT

A speech encoder including a pitch detector operative to determine the pitch frequency of a speech segment, a spectral estimator operative to estimate the complex spectrum of the speech segment at the pitch frequency, an envelope encoder operative to calculate the amplitude of the complex spectrum, a phase aligner operative to remove a phase term which is linear in frequency from each of a plurality of complex values of the complex spectrum, and calculate a series of division products of each of the plurality of complex values by the square root of the absolute value of each of the complex values, where the series has a minimum total variation, thereby resulting in an aligned phase θ k . and a phase encoder operative to encode the phase information.

FIELD OF THE INVENTION

[0001] The present invention relates to speech processing in general, and more particularly to phase alignment thereof.

BACKGROUND OF THE INVENTION

[0002] Many speech encoding and decoding systems represent voice segments by their spectral envelope. In some systems the segments are represented only by the absolute magnitude of the spectrum, and the phase is generated synthetically for the reconstruction. Such systems suffer from poor initial phase alignment which results in poor compression of phase data and poor combination with the synthetic phase. They also do not allow real and synthetic phase data to be combined in the same frame, and their final alignment suffers from poor segment connection.

SUMMARY OF THE INVENTION

[0003] The present invention discloses a method for improving the sound quality of compressed speech by encoding the complex phase of the spectral envelope and using the encoded phase information during decoding to reproduce a speech segment having a smooth transition from the previous segment. The phase encoder of the present invention can work independently or in combination with amplitude encoding. During decoding, the decoder combines decoded phase information with the spectrum created from decoded amplitude information. The decoder then aligns the complex spectrum of the current segment with the spectrum of the previous segment to produce the desired pitch cycles. The present invention provides improved speech quality by using alignment both in the encoder and the decoder, by improving both alignment methods, and by allowing combination of real and synthetic phase data.

[0004] In one aspect of the present invention a speech encoder is provided including a pitch detector operative to determine the pitch frequency of a speech segment, a spectral estimator operative to estimate the complex spectrum of the speech segment at the pitch frequency, an envelope encoder operative to calculate the amplitude of the complex spectrum, a phase aligner operative to remove a phase term which is linear in frequency from each of a plurality of complex values of the complex spectrum, and calculate a series of division products of each of the plurality of complex values by the square root of the absolute value of each of the complex values, where the series has a minimum total variation, thereby resulting in an aligned phase θ_(k), and a phase encoder operative to encode the phase information.

[0005] In another aspect of the present invention the spectral estimator is operative to estimate a signal of the complex spectrum at a time t as ${x(t)} \cong {\sum\limits_{k}\quad {A_{k}^{{\phi}_{k}}^{2\pi \quad {if}_{k}t}}}$

[0006] where A_(k) is the amplitude of the speech segment and φ_(k) is the phase of each pitch harmonic f_(k) of the speech segment.

[0007] In another aspect of the present invention the spectral estimator is a Fourier transformator operative to calculate Fourier coefficients at multiples of the pitch frequency.

[0008] In another aspect of the present invention the phase aligner is operative to calculate the aligned phase θ_(k) of the complex spectrum after a time offset τ as θ_(k)=φ_(k)−2πτf_(k).

[0009] In another aspect of the present invention the phase aligner is operative to calculate the linear phase term having a coefficientτ being $\tau = {\arg {\quad \quad}{\min_{\tau}{\sum\limits_{k = 0}^{N - 1}\quad {{{\sqrt{A_{k + 1}}^{{\phi}_{k + 1} - {2{{\pi\tau}{({f_{k + 1} - f_{k}})}}}}} - {\sqrt{A_{k}}^{{\phi}_{k}}}}}^{2}}}}$

[0010] where the coefficientτ is operative to minimize the total variation of the complex spectrum divided by the square root of its absolute value.

[0011] In another aspect of the present invention a phase aligner is provided including means for removing a phase term which is linear in frequency from each of a plurality of complex values of a complex spectrum of a speech segment, and means for calculating a series of division products of each of the plurality of complex values by the square root of the absolute value of each of the complex values, where the series has a minimum total variation, thereby resulting in an aligned phase θ_(k).

[0012] In another aspect of the present invention the means for calculating is operative to calculate the aligned phase θ_(k) of the complex spectrum after a time offset τ as θ_(k)=φ_(k)−2πτf_(k).

[0013] In another aspect of the present invention the means for removing is operative to calculate the linear phase term having a coefficientτ being $\tau = {\arg {\quad \quad}{\min_{\tau}{\sum\limits_{k = 0}^{N - 1}\quad {{{\sqrt{A_{k + 1}}^{{\phi}_{k + 1} - {2{{\pi\tau}{({f_{k + 1} - f_{k}})}}}}} - {\sqrt{A_{k}}^{{\phi}_{k}}}}}^{2}}}}$

[0014] where the coefficientτ is operative to minimize the total variation of the complex spectrum divided by the square root of its absolute value.

[0015] In another aspect of the present invention a speech decoder is provided including a spectrum reconstructor operative to reconstruct the spectrum of a speech segment from the amplitude envelope of the spectrum of the speech segment and pitch information, a phase combiner operative to reconstruct the complex spectrum of the speech segment from the reconstructed spectrum, phase information describing the speech segment, and pitch information describing the speech segment, a delay operative to store a complex spectrum of a previous speech segment, and a segment aligner operative to determine the relative offset between the complex spectrum of the speech segment and the complex spectrum of the previous speech segment, align the position of the first pitch excitation of the current speech segment to the last pitch excitation of the previous speech segment, and apply a time shift and a complex Hilbert filter to the complex spectra.

[0016] In another aspect of the present invention the speech decoder further includes an inverse Fourier transformator operative to convert the aligned complex spectra into time-domain signals and concatenate the time-domain signals with at least one other speech segment.

[0017] In another aspect of the present invention the pitch information describes the pitch of the speech segment prior to encoding.

[0018] In another aspect of the present invention the segment aligner is operative to cross-correlate the complex spectra as ${{C(\tau)} = {\sum\limits_{n = 0}^{N}\quad {F_{n}{\overset{\_}{G}}_{m}^{{- 2}\pi \quad {in}\quad \tau}}}},{m = {\left\lfloor {{n\frac{p_{G}}{p_{F}}} + 0.5} \right\rfloor.}}$

[0019] where F_(n) and G_(m) are the computed complex magnitude of the pitch harmonics n and m of the current and previous spectra respectively, and p_(F) and p_(G) are their corresponding pitch periods.

[0020] In another aspect of the present invention the segment aligner is operative to cross-correlate on the Hilbert transform of the spectra and sum only the positive frequencies ( n, m≧0 ) of the spectra.

[0021] In another aspect of the present invention the segment aligner is operative to apply a time shift τ_(m)=arg max{|C(τ)|} and a constant phase shift θ₀=−arg(C(τ_(m))) to the current spectrum.

[0022] In another aspect of the present invention the segment aligner is operative to determine the offset of the current complex spectrum as δ=n_(p)p_(G)−ΔT where there are $\quad {n_{p} = \left\lfloor {\frac{\Delta \quad T}{p_{G}} + 0.5} \right\rfloor}$

[0023] pitch cycles in the previous complex spectrum, and where ΔT is the time offset between the complex spectra.

[0024] In another aspect of the present invention the segment aligner is operative to apply the time shift and the complex Hilbert filter by multiplying F_(n)(t) with e^(lΔθ) ^(_(n)) , where Δθ_(n) is given by ${\Delta\theta}_{n} = \left\{ {{\begin{matrix} {\theta_{0} + {n\quad \theta_{1}}} & {n \geq 0} \\ {{- \theta_{0}} + {n\quad \theta_{1}}} & {n < 0} \end{matrix}{with}\quad \theta_{1}} = {{- 2}{{\pi \left( {\tau_{m} + \frac{\delta}{p_{F}}} \right)}.}}} \right.$

[0025] In another aspect of the present invention a segment aligner is provided including means for determining the relative offset between a complex spectrum of a speech segment and a complex spectrum of a previous speech segment, means for aligning the position of the first pitch excitation of the current speech segment to the last pitch excitation of the previous speech segment, and means for applying a time shift and a complex Hilbert filter to the complex spectra.

[0026] In another aspect of the present invention the means for determining is operative to cross-correlate the complex spectra as $\begin{matrix} {{{C(\tau)} = {\sum\limits_{n = 0}^{N}\quad {F_{n}{\overset{\_}{G}}_{m}^{{- 2}\pi \quad {in}\quad \tau}}}},} \\ {{m = \left\lfloor {{n\frac{p_{G}}{p_{F}}} + 0.5} \right\rfloor},} \end{matrix}$

[0027] where F_(n) and G_(m) are the computed complex magnitude of the pitch harmonics n and m of the current and previous spectra respectively, and p_(F) and p_(G) are their corresponding pitch periods.

[0028] In another aspect of the present invention the means for determining is operative to cross-correlate on the Hilbert transform of the spectra and sum only the positive frequencies (n, m≧0) of the spectra.

[0029] In another aspect of the present invention the means for aligning is operative to apply a time shift τ_(m)=arg max{|C(τ)|} and a constant phase shift θ₀=−arg(C(τ_(m))) to the current spectrum.

[0030] In another aspect of the present invention the means for determining is operative to determine the offset of the current complex spectrum as δ=n_(p)p_(G)−ΔT where there are $n_{p} = \left\lfloor {\frac{\Delta \quad T}{p_{G}} + 0.5} \right\rfloor$

[0031] pitch cycles in the previous complex spectrum, and where ΔT is the time offset between the complex spectra.

[0032] In another aspect of the present invention the means for aligning is operative to apply the time shift and the complex Hilbert filter by multiplying F_(n)(t) with e^(lΔθ) ^(_(n)) , where Δθ_(n) is given by ${\Delta\theta}_{n} = \left\{ {{\begin{matrix} {\theta_{0} + {n\quad \theta_{1}}} & {n \geq 0} \\ {{- \theta_{0}} + {n\quad \theta_{1}}} & {n < 0} \end{matrix}{with}\quad \theta_{1}} = {{- 2}{{\pi \left( {\tau_{m} + \frac{\delta}{p_{F}}} \right)}.}}} \right.$

[0033] In another aspect of the present invention a method is provided for speech encoding including determining the pitch frequency of a speech segment, estimating the complex spectrum of the speech segment at the pitch frequency, calculating the amplitude of the complex spectrum, removing a phase term which is linear in frequency from each of a plurality of complex values of the complex spectrum, calculating a series of division products of each of the plurality of complex values by the square root of the absolute value of each of the complex values, where the series has a minimum total variation, thereby resulting in an aligned phase θ_(k), and encoding the phase information.

[0034] In another aspect of the present invention the estimating step includes estimating a signal of the complex spectrum at a time t as ${x(t)} \cong {\sum\limits_{k}\quad {A_{k}^{{\phi}_{k}}^{2\pi \quad {if}_{k}t}}}$

[0035] where A_(k) is the amplitude of the speech segment and φ_(k) is the phase of each pitch harmonic f_(k) of the speech segment.

[0036] In another aspect of the present invention the estimating step includes calculating Fourier coefficients at multiples of the pitch frequency.

[0037] In another aspect of the present invention the calculating a series step includes calculating the aligned phase θ_(k) of the complex spectrum after a time offset τ as θ_(k)=φ_(k)−2πτf_(k).

[0038] In another aspect of the present invention the removing step includes calculating the linear phase term having a coefficientτ being $\tau = \left. {{\arg \quad {\min_{\tau}{\underset{k = 0}{\overset{N - 1}{\left. \sum \right|}}\quad \sqrt{A_{k + 1}}^{{\quad \phi_{k + 1}} - {2\pi \quad {\tau {({f_{k + 1} - f_{k}})}}}}}}} - {\sqrt{A_{k}}^{\quad \phi_{k}}}} \right|^{2}$

[0039] where the coefficientτ is operative to minimize the total variation of the complex spectrum divided by the square root of its absolute value.

[0040] In another aspect of the present invention a method is provided for phase aligning including removing a phase term which is linear in frequency from each of a plurality of complex values of a complex spectrum of a speech segment, and calculating a series of division products of each of the plurality of complex values by the square root of the absolute value of each of the complex values, where the series has a minimum total variation, thereby resulting in an aligned phase θ_(k).

[0041] In another aspect of the present invention the calculating step includes calculating the aligned phase θ_(k) of the complex spectrum after a time offset τ as θ_(k)=φ_(k)−2πτf_(k).

[0042] In another aspect of the present invention the removing step includes calculating the linear phase term having a coefficientτ being $\tau = \left. {{\arg \quad {\min_{\tau}{\underset{k = 0}{\overset{N - 1}{\left. \sum \right|}}\quad \sqrt{A_{k + 1}}^{{\quad \phi_{k + 1}} - {2\pi \quad {\tau {({f_{k + 1} - f_{k}})}}}}}}} - {\sqrt{A_{k}}^{\quad \phi_{k}}}} \right|^{2}$

[0043] where the coefficientτ is operative to minimize the total variation of the complex spectrum divided by the square root of its absolute value.

[0044] In another aspect of the present invention a method is provided for speech decoding including reconstructing the spectrum of a speech segment from the amplitude envelope of the spectrum of the speech segment and pitch information, reconstructing the complex spectrum of the speech segment from the reconstructed spectrum, phase information describing the speech segment, and pitch information describing the speech segment, storing a complex spectrum of a previous speech segment, determining the relative offset between the complex spectrum of the speech segment and the complex spectrum of the previous speech segment, aligning the position of the first pitch excitation of the current speech segment to the last pitch excitation of the previous speech segment, and applying a time shift and a complex Hilbert filter to the complex spectra.

[0045] In another aspect of the present invention the method further includes converting the aligned complex spectra into time-domain signals, and concatenating the time-domain signals with at least one other speech segment.

[0046] In another aspect of the present invention the reconstructing the spectrum step includes reconstructing with the pitch information that describes the pitch of the speech segment prior to encoding.

[0047] In another aspect of the present invention the determining step includes cross-correlating the complex spectra as ${{C(\tau)} = {\sum\limits_{n = 0}^{N}\quad {F_{n}{\overset{\_}{G}}_{m}^{{- 2}{\pi }\quad n\quad \tau}}}},{m = {\left\lfloor {{n\frac{p_{G}}{p_{F}}} + 0.5} \right\rfloor.}}$

[0048] where F_(n) and G_(m) are the computed complex magnitude of the pitch harmonics n and m of the current and previous spectra respectively, and p_(F) and p_(G) are their corresponding pitch periods.

[0049] In another aspect of the present invention the determining step includes cross-correlating on the Hilbert transform of the spectra and sum only the positive frequencies (n, m≧0) of the spectra.

[0050] In another aspect of the present invention the aligning step includes applying a time shift τ_(m)=arg max{|C(τ)|} and a constant phase shift θ₀=−arg(C(τ_(m))) to the current spectrum.

[0051] In another aspect of the present invention the determining step includes determining the offset of the current complex spectrum as δ=n_(p)p_(G)−ΔT where there are $n_{p} = \left\lfloor {\frac{\Delta \quad T}{p_{G}} + 0.5} \right\rfloor$

[0052] pitch cycles in the previous complex spectrum, and where ΔT is the time offset between the complex spectra.

[0053] In another aspect of the present invention the aligning step includes applying the time shift and the complex Hilbert filter by multiplying F_(n)(t) with e^(lΔθ) ^(_(n)) , where Δθ_(n) is given by ${\Delta \quad \theta_{n}} = \left\{ {{\begin{matrix} {{\theta_{0} + {n\quad \theta_{1}\quad n}} \geq 0} \\ {{{{- \theta_{0}} + {n\quad \theta_{1}\quad n}} < 0}\quad} \end{matrix}{with}\quad \theta_{1}} = {{- 2}{{\pi \left( {\tau_{m} + \frac{\delta}{p_{F}}} \right)}.}}} \right.$

[0054] In another aspect of the present invention a method is provided for segment aligning including determining the relative offset between a complex spectrum of a speech segment and a complex spectrum of a previous speech segment, aligning the position of the first pitch excitation of the current speech segment to the last pitch excitation of the previous speech segment, and applying a time shift and a complex Hilbert filter to the complex spectra.

[0055] In another aspect of the present invention the determining step includes cross-correlating the complex spectra as ${{C(\tau)} = {\sum\limits_{n = 0}^{N}\quad {F_{n}{\overset{\_}{G}}_{m}^{{- 2}\pi \quad \quad n\quad \tau}}}},{m = \left\lfloor {{n\frac{p_{G}}{p_{F}}} + 0.5} \right\rfloor},$

[0056] where F_(n) and G_(m) are the computed complex magnitude of the pitch harmonics n and m of the current and previous spectra respectively, and p_(F) and p_(G) are their corresponding pitch periods.

[0057] In another aspect of the present invention the determining step includes cross-correlating on the Hilbert transform of the spectra and sum only the positive frequencies (n, m≧0) of the spectra.

[0058] In another aspect of the present invention the aligning step includes applying a time shift τ_(m)=arg max{|C(τ)|} and a constant phase shift θ₀=−arg(C(τ_(m))) to the current spectrum.

[0059] In another aspect of the present invention the determining step includes determining the offset of the current complex spectrum as δ=n_(p)p_(G)−ΔT where there are $n_{p} = \left\lfloor {\frac{\Delta \quad T}{p_{G}} + 0.5} \right\rfloor$

[0060] pitch cycles in the previous complex spectrum, and where ΔT is the time offset between the complex spectra.

[0061] In another aspect of the present invention the aligning step includes applying the time shift and the complex Hilbert filter by multiplying F_(n)(t) with e^(lΔθ) ^(_(n)) , where Δθ_(n) is given by ${\Delta \quad \theta_{n}} = \left\{ {{\begin{matrix} {{\theta_{0} + {n\quad \theta_{1}\quad n}} \geq 0} \\ {{{{- \theta_{0}} + {n\quad \theta_{1}\quad n}} < 0}\quad} \end{matrix}{with}\quad \theta_{1}} = {{- 2}{{\pi \left( {\tau_{m} + \frac{\delta}{p_{F}}} \right)}.}}} \right.$

[0062] In another aspect of the present invention a computer program is provided embodied on a computer-readable medium, the computer program including a first code segment operative to determine the pitch frequency of a speech segment, a second code segment operative to estimate the complex spectrum of the speech segment at the pitch frequency, a third code segment operative to calculate the amplitude of the complex spectrum, a fourth code segment operative to remove a phase term which is linear in frequency from each of a plurality of complex values of the complex spectrum, and calculate a series of division products of each of the plurality of complex values by the square root of the absolute value of each of the complex values, where the series has a minimum total variation, thereby resulting in an aligned phase θ_(k), and a fifth code segment operative to encode the phase information.

[0063] In another aspect of the present invention a computer program is provided embodied on a computer-readable medium, the computer program including a first code segment operative to reconstruct the spectrum of a speech segment from the amplitude envelope of the spectrum of the speech segment and pitch information, a second code segment operative to reconstruct the complex spectrum of the speech segment from the reconstructed spectrum, phase information describing the speech segment, and pitch information describing the speech segment, a third code segment operative to store a complex spectrum of a previous speech segment, and a fourth code segment operative to determine the relative offset between the complex spectrum of the speech segment and the complex spectrum of the previous speech segment, align the position of the first pitch excitation of the current speech segment to the last pitch excitation of the previous speech segment, and apply a time shift and a complex Hilbert filter to the complex spectra.

BRIEF DESCRIPTION OF THE DRAWINGS

[0064] The present invention will be understood and appreciated more fully from the following detailed description taken in conjunction with the appended drawings in which:

[0065]FIG. 1 is a simplified block diagram illustration of a speech encoder, constructed and operative in accordance with a preferred embodiment of the present invention;

[0066]FIG. 2 is a simplified flow illustration of an exemplary method of operation of phase aligner 106 of the speech encoder of FIG. 1, operative in accordance with a preferred embodiment of the present invention;

[0067]FIG. 3 is a simplified block diagram illustration of a speech decoder, constructed and operative in accordance with a preferred embodiment of the present invention;

[0068]FIG. 4 is a simplified flow illustration of an exemplary method of operation of phase combiner 302 of the speech decoder of FIG. 3, operative in accordance with a preferred embodiment of the present invention;

[0069]FIG. 5 is a simplified flow illustration of an exemplary method of operation of segment aligner 304 of the speech decoder of FIG. 3, operative in accordance with a preferred embodiment of the present invention; and

[0070]FIGS. 6A, 6B, and 6C are simplified graphical illustrations showing the phase alignment of speech segments in accordance with the application of the methods of the present invention.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

[0071] Reference is now made to FIG. 1, which is a simplified block diagram illustration of a speech encoder, constructed and operative in accordance with a preferred embodiment of the present invention. In the speech encoder of FIG. 1, a speech segment is input into a pitch detector 100 which determines the pitch of the speech segment. The speech segment is also input into a spectral estimator 102, such as a Fourier transformator, which estimates the complex spectrum of the speech segment. An envelope encoder 104 calculates the amplitude of the complex spectrum. A phase aligner 106 extracts the phase information from the complex spectrum. The phase information is then encoded at a phase encoder 108.

[0072] Reference is now made to FIG. 2, which is a simplified flow illustration of an exemplary method of operation of phase aligner 106 of the speech encoder of FIG. 1, operative in accordance with a preferred embodiment of the present invention. In the method of FIG. 2 the spectrum of the input speech segment is calculated. For a voiced segment, the speech signal at time t is estimated by the amplitudes A_(k) and the phases φ_(k) of each pitch harmonics f_(k) ${x(t)} \cong {\sum\limits_{k}^{\quad}\quad {A_{k}^{\quad \phi_{k}}^{2\pi \quad \quad f_{k}t}}}$

[0073] The segment is then phase-aligned by removing a linear phase term in order to smooth the phase data and reduce phase wrapping. The aligned phase θ_(k) after a time offset τ is applied will be:

θ_(k)=φ_(k)−2πτf _(k)

[0074] τ is preferably selected to make the complex spectrum as smooth as possible by minimizing the total variation of the of the spectrum divided by the square root of it's absolute value: $\tau = \left. {{\arg \quad {\min_{\tau}{\underset{k = 0}{\overset{N - 1}{\left. \sum \right|}}\quad \sqrt{A_{k + 1}}^{{\quad \phi_{k + 1}} - {2\pi \quad {\tau {({f_{k + 1} - f_{k}})}}}}}}} - {\sqrt{A_{k}}^{\quad \phi_{k}}}} \middle| {}_{2}. \right.$

[0075] Since the aligned phase is smooth it is possible to estimate the complex spectrum at an arbitrary frequency by interpolation and to combine it with a phase produced by any conventional method.

[0076] In order to reduce the amount of data to be encoded, it is possible to encode only the phase of the first M pitch harmonics, where M is a parameter that controls the trade-off between quality and bandwidth. It may be user-defined or set automatically using preset values according to various parameters such as the speech bandwidth, the speaker voice, and the required quality.

[0077] The aligned phase θ_(n) is then encoded using quantization and/or compression by any suitable methods known in the art.

[0078] Reference is now made to FIG. 3, which is a simplified block diagram illustration of a speech decoder, constructed and operative in accordance with a preferred embodiment of the present invention. In the speech decoder of FIG. 3, the spectrum of a speech segment is reconstructed at a spectrum reconstructor 300 using conventional means by inputting the amplitude envelope of the spectrum of the speech segment together with pitch information, which may be user-defined using known techniques, and which may or may not match the pitch of the original speech segment. The reconstructed spectrum is then input into a phase combiner 302 together with the encoded phase information and the pitch information of the original speech segment. Phase combiner 302 decodes the encoded information and reconstructs the segment's complex spectrum. The complex spectrum and the user-defined pitch information is then input into a segment aligner 304 which pitch-aligns the complex phase of the spectrum of the current speech segment to a previous speech segment that is stored in a delay 306. The phase-aligned spectrum is then input into an inverse Fourier transformator 308 which converts it into time-domain signals and concatenates it with the previous speech segment.

[0079] Reference is now made to FIG. 4, which is a simplified flow illustration of exemplary method of operation of phase combiner 302 of the speech decoder of FIG. 3, operative in accordance with a preferred embodiment of the present invention. In the method of FIG. 4 the encoded phase is decoded and the values of the input speech segment's spectrum are set by: $F_{n} = \left\{ \begin{matrix} {A_{n}^{\prime}^{\quad \theta_{n}}} & {n < M} \\ {A_{n}^{\prime}^{\quad \varphi_{n}}} & {otherwise} \end{matrix} \right.$

[0080] where A′_(n)e^(lφ) ^(_(n)) is the spectrum reconstructed from the encoded amplitude and pitch only, using a synthetic phase. When the pitch of the original segment differs from the pitch of the reconstructed segment, linear interpolation of the decoded phase may be used in order to estimate the phase values at the required frequencies.

[0081] Reference is now made to FIG. 5, which is a simplified flow illustration of an exemplary method of operation of segment aligner 304 of the speech decoder of FIG. 3, operative in accordance with a preferred embodiment of the present invention. In the method of FIG. 5, the relative offset between the current segment and the previous one is determined. The relative alignment between the segments may be found from their cross correlation function: ${{C(\tau)} = {\sum\limits_{n = 0}^{N}{F_{n}{\overset{\_}{G}}_{m}^{{- 2}\quad \pi \quad \quad n\quad \tau}}}},{m = {\left\lfloor {{n\frac{p_{G}}{p_{F}}} + 0.5} \right\rfloor.}}$

[0082] where F_(n) and G_(m) are the computed complex magnitude of the pitch harmonics n and m of the current and previous segments respectively, and p_(F) and p_(G) are the corresponding pitch periods. The correlation is preferably performed on the Hilbert transform of the segments, and thus only the positive frequencies (n, m≧0) are summed. Optimal correlation of the two Hilbert-transformed signals is preferably achieved by applying a time shift:

τ_(m) =arg max{|C(τ)|}

[0083] and a complex phase shift θ₀=−arg(C(τ_(m))) to the current segment.

[0084] After the two segments are relatively aligned, the position of the first pitch excitation of the current segment is aligned to the last pitch excitation of the previous segment. If in the previous segment there are $n_{p} = \left\lfloor {\frac{\Delta \quad T}{p_{G}} + 0.5} \right\rfloor$

[0085] pitch cycles, where ΔT is the time offset between segments, the offset in the current segment will be

δ=n _(p) p _(G) −ΔT.

[0086] The segments are then realigned by applying a time shift and a complex Hilbert filter. This is achieved by multiplying F_(n)(t) with e^(lΔθ) ^(_(n)) , where Δθ_(n) is given by ${\Delta \quad \theta_{n}} = \left\{ {{\begin{matrix} {\theta_{0} + {n\quad \theta_{1}}} & {n \geq 0} \\ {{- \theta_{0}} + {n\quad \theta_{1}}} & {n < 0} \end{matrix}{with}\theta_{1}} = {{- 2}\quad {\pi \left( {\tau_{m} + \frac{\delta}{p_{I}}} \right)}}} \right.$

[0087]FIGS. 6A, 6B, and 6C are simplified graphical illustrations showing the phase alignment of two speech segments 600 and 602 in accordance with the application of the methods of the present invention described hereinabove.

[0088] It is appreciated that one or more of the steps of any of the methods described herein may be omitted or carried out in a different order than that shown, without departing from the true spirit and scope of the invention.

[0089] While the methods and apparatus disclosed herein may or may not have been described with reference to specific computer hardware or software, it is appreciated that the methods and apparatus described herein may be readily implemented in computer hardware or software using conventional techniques.

[0090] While the present invention has been described with reference to one or more specific embodiments, the description is intended to be illustrative of the invention as a whole and is not to be construed as limiting the invention to the embodiments shown. It is appreciated that various modifications may occur to those skilled in the art that, while not specifically shown herein, are nevertheless within the true spirit and scope of the invention. 

What is claimed is:
 1. A speech encoder comprising: a pitch detector operative to determine the pitch frequency of a speech segment; a spectral estimator operative to estimate the complex spectrum of said speech segment at said pitch frequency; an envelope encoder operative to calculate the amplitude of said complex spectrum; a phase aligner operative to: remove a phase term which is linear in frequency from each of a plurality of complex values of the complex spectrum; and calculate a series of division products of each of the plurality of complex values by the square root of the absolute value of each of said complex values, wherein said series has a minimum total variation, thereby resulting in an aligned phase θ_(k); and a phase encoder operative to encode said phase information.
 2. A speech encoder according to claim 1 wherein said spectral estimator is operative to estimate a signal of said complex spectrum at a time t as ${x(t)} \cong {\sum\limits_{k}^{\quad}{A_{k}^{\quad \phi_{k}}^{2\quad \pi \quad \quad f_{k}t}}}$

where A_(k) is the amplitude of said speech segment and φ_(k) is the phase of each pitch harmonic f_(k) of said speech segment.
 3. A speech encoder according to claim 2 wherein said spectral estimator is a Fourier transformator operative to calculate Fourier coefficients at multiples of said pitch frequency.
 4. A speech encoder according to claim 1 wherein said phase aligner is operative to calculate said aligned phase θ_(k) of said complex spectrum after a time offset τ as θ_(k)=φ_(k)−2πτf_(k).
 5. A speech encoder according to claim 1 wherein said phase aligner is operative to calculate said linear phase term having a coefficientτ being $\tau = {{argmin}_{\tau}{\sum\limits_{k = 0}^{N - 1}{{{\sqrt{A_{k + 1}}^{{\quad \phi_{k + 1}} - {2\quad \pi \quad {\tau {({f_{k + 1} - f_{k}})}}}}} - {\sqrt{A_{k}}^{\iota \quad \phi_{k}}}}}^{2}}}$

wherein said coefficientτ is operative to minimize the total variation of said complex spectrum divided by the square root of its absolute value.
 6. A phase aligner comprising: means for removing a phase term which is linear in frequency from each of a plurality of complex values of a complex spectrum of a speech segment; and means for calculating a series of division products of each of the plurality of complex values by the square root of the absolute value of each of said complex values, wherein said series has a minimum total variation, thereby resulting in an aligned phase θ_(k).
 7. A phase aligner according to claim 6 wherein said means for calculating is operative to calculate said aligned phase θ_(k) of said complex spectrum after a time offset τ as θ_(k)=φ_(k)−2πτf_(k).
 8. A phase aligner according to claim 6 wherein said means for removing is operative to calculate said linear phase term having a coefficientτ being $\tau = {{argmin}_{\tau}{\sum\limits_{k = 0}^{N - 1}{{{\sqrt{A_{k + 1}}^{{\quad \phi_{k + 1}} - {2\quad \pi \quad {\tau {({f_{k + 1} - f_{k}})}}}}} - {\sqrt{A_{k}}^{\iota \quad \phi_{k}}}}}^{2}}}$

wherein said coefficient: is operative to minimize the total variation of said complex spectrum divided by the square root of its absolute value.
 9. A speech decoder comprising: a spectrum reconstructor operative to reconstruct the spectrum of a speech segment from the amplitude envelope of the spectrum of said speech segment and pitch information; a phase combiner operative to reconstruct the complex spectrum of said speech segment from said reconstructed spectrum, phase information describing said speech segment, and pitch information describing said speech segment; a delay operative to store a complex spectrum of a previous speech segment; and a segment aligner operative to: determine the relative offset between said complex spectrum of said speech segment and the complex spectrum of said previous speech segment; align the position of the first pitch excitation of said current speech segment to the last pitch excitation of said previous speech segment; and apply a time shift and a complex Hilbert filter to said complex spectra.
 10. A speech decoder according to claim 9 and further comprising an inverse Fourier transformator operative to convert said aligned complex spectra into time-domain signals and concatenate said time-domain signals with at least one other speech segment.
 11. A speech decoder according to claim 9 wherein said pitch information describes the pitch of said speech segment prior to encoding.
 12. A speech decoder according to claim 9 wherein said segment aligner is operative to cross-correlate said complex spectra as ${{C(\tau)} = {\sum\limits_{n = 0}^{N}{F_{n}{\overset{\_}{G}}_{m}^{{- 2}\quad \pi \quad \quad n\quad \tau}}}},{m = {\left\lfloor {{n\frac{p_{G}}{p_{F}}} + 0.5} \right\rfloor.}}$

where F_(n) and G_(m) are the computed complex magnitude of the pitch harmonics n and m of the current and previous spectra respectively, and p_(F) and p_(G) are their corresponding pitch periods.
 13. A speech decoder according to claim 12 wherein said segment aligner is operative to cross-correlate on the Hilbert transform of said spectra and sum only the positive frequencies (n, m≧0) of said spectra.
 14. A speech decoder according to claim 12 wherein said segment aligner is operative to apply a time shiftτ_(m)=arg max{|C(τ)|} and a constant phase shift θ₀=−arg(C(τ_(m))) to said current spectrum.
 15. A speech decoder according to claim 9 wherein said segment aligner is operative to determine said offset of said current complex spectrum as δ=n_(p)p_(G)−ΔT where there are $n_{p} = \left\lfloor {\frac{\Delta \quad T}{p_{G}} + 0.5} \right\rfloor$

pitch cycles in said previous complex spectrum, and where ΔT is the time offset between said complex spectra.
 16. A speech decoder according to claim 9 wherein said segment aligner is operative to apply said time shift and said complex Hilbert filter by multiplying F_(n)(t) with e^(lΔθ) ^(_(n)) , where Δθ_(n) is given by ${\Delta \quad \theta_{n}} = \left\{ {{\begin{matrix} {\theta_{0} + {n\quad \theta_{1}}} & {n \geq 0} \\ {{- \theta_{0}} + {n\quad \theta_{1}}} & {n < 0} \end{matrix}{with}\theta_{1}} = {{- 2}\quad {{\pi \left( {\tau_{m} + \frac{\delta}{p_{F}}} \right)}.}}} \right.$


17. A segment aligner comprising: means for determining the relative offset between a complex spectrum of a speech segment and a complex spectrum of a previous speech segment; means for aligning the position of the first pitch excitation of said current speech segment to the last pitch excitation of said previous speech segment; and means for applying a time shift and a complex Hilbert filter to said complex spectra.
 18. A segment aligner according to claim 17 wherein said means for determining is operative to cross-correlate said complex spectra as ${{C(\tau)} = {\sum\limits_{n = 0}^{N}\quad {F_{n}{\overset{\_}{G}}_{m}^{{- 2}\pi \quad \quad n\quad \tau}}}},{m = \left\lfloor {{n\frac{p_{G}}{p_{F}}} + 0.5} \right\rfloor},$

where F_(n) and G_(m) are the computed complex magnitude of the pitch harmonics n and m of the current and previous spectra respectively, and p_(F) and p_(G) are their corresponding pitch periods.
 19. A segment aligner according to claim 18 wherein said means for determining is operative to cross-correlate on the Hilbert transform of said spectra and sum only the positive frequencies (n, m≧0) of said spectra.
 20. A segment aligner according to claim 18 wherein said means for aligning is operative to apply a time shiftτ_(m)=arg max{|C(τ)|} and a constant phase shift θ₀=−arg(C(τ_(m))) to said current spectrum.
 21. A segment aligner according to claim 17 wherein said means for determining is operative to determine said offset of said current complex spectrum as δ=n_(p)p_(G)−ΔT where there are $n_{p} = \left\lfloor {\frac{\Delta \quad T}{p_{G}} + 0.5} \right\rfloor$

pitch cycles in said previous complex spectrum, and where ΔT is the time offset between said complex spectra.
 22. A segment aligner according to claim 17 wherein said means for aligning is operative to apply said time shift and said complex Hilbert filter by multiplying F_(n)(t) with e^(lΔθ) ^(_(n)) , whereΔθ_(n) is given by $\begin{matrix} {{\Delta \quad \theta_{n}} = \left\{ \begin{matrix} {{\theta_{0} + {n\quad \theta_{1}}}\quad} & {n \geq 0} \\ {{- \theta_{0}} + {n\quad \theta_{1}}} & {n < 0} \end{matrix} \right.} \\ {with} \\ {\theta_{1} = {{- 2}{{\pi \left( {\tau_{m} + \frac{\delta}{p_{F}}} \right)}.}}} \end{matrix}$


23. A method for speech encoding comprising: determining the pitch frequency of a speech segment; estimating the complex spectrum of said speech segment at said pitch frequency; calculating the amplitude of said complex spectrum; removing a phase term which is linear in frequency from each of a plurality of complex values of the complex spectrum; calculating a series of division products of each of the plurality of complex values by the square root of the absolute value of each of said complex values, wherein said series has a minimum total variation, thereby resulting in an aligned phase θ_(k); and encoding said phase information.
 24. A method according to claim 23 wherein said estimating step comprises estimating a signal of said complex spectrum at a time t as ${x(t)} \cong {\sum\limits_{k}^{\quad}\quad {A_{k}^{\quad \phi_{k}}^{2\quad \pi \quad \quad f_{k}t}}}$

where A_(k) is the amplitude of said speech segment and φ_(k) is the phase of each pitch harmonic f_(k) of said speech segment.
 25. A method according to claim 23 wherein said calculating a series step comprises calculating said aligned phase θ_(k) of said complex spectrum after a time offset τ as θ_(k)=φ_(k)−2πτf_(k).
 26. A method according to claim 23 wherein said removing step comprises calculating said linear phase term having a coefficientτ being $\tau = {\arg \quad {\min_{\tau}{\sum\limits_{k = 0}^{N - 1}\quad {{{\sqrt{A_{k + 1}}^{{\quad \phi_{k + 1}} - {2\pi \quad {\tau {({f_{k + 1} - f_{k}})}}}}} - {\sqrt{A_{k}}^{\quad \phi_{k}}}}}^{2}}}}$

wherein said coefficients is operative to minimize the total variation of said complex spectrum divided by the square root of its absolute value.
 27. A method for speech decoding comprising: reconstructing the spectrum of a speech segment from the amplitude envelope of the spectrum of said speech segment and pitch information; reconstructing the complex spectrum of said speech segment from said reconstructed spectrum, phase information describing said speech segment, and pitch information describing said speech segment; storing a complex spectrum of a previous speech segment; determining the relative offset between said complex spectrum of said speech segment and the complex spectrum of said previous speech segment; aligning the position of the first pitch excitation of said current speech segment to the last pitch excitation of said previous speech segment; and applying a time shift and a complex Hilbert filter to said complex spectra.
 28. A method according to claim 27 and further comprising: converting said aligned complex spectra into time-domain signals; and concatenating said time-domain signals with at least one other speech segment.
 29. A method for segment aligning comprising: determining the relative offset between a complex spectrum of a speech segment and a complex spectrum of a previous speech segment; aligning the position of the first pitch excitation of said current speech segment to the last pitch excitation of said previous speech segment; and applying a time shift and a complex Hilbert filter to said complex spectra.
 30. A computer program embodied on a computer-readable medium, the computer program comprising: a first code segment operative to determine the pitch frequency of a speech segment; a second code segment operative to estimate the complex spectrum of said speech segment at said pitch frequency; a third code segment operative to calculate the amplitude of said complex spectrum; a fourth code segment operative to: remove a phase term which is linear in frequency from each of a plurality of complex values of the complex spectrum; and calculate a series of division products of each of the plurality of complex values by the square root of the absolute value of each of said complex values, wherein said series has a minimum total variation, thereby resulting in an aligned phase θ_(k); and a fifth code segment operative to encode said phase information.
 31. A computer program embodied on a computer-readable medium, the computer program comprising: a first code segment operative to reconstruct the spectrum of a speech segment from the amplitude envelope of the spectrum of said speech segment and pitch information; a second code segment operative to reconstruct the complex spectrum of said speech segment from said reconstructed spectrum, phase information describing said speech segment, and pitch information describing said speech segment; a third code segment operative to store a complex spectrum of a previous speech segment; and a fourth code segment operative to: determine the relative offset between said complex spectrum of said speech segment and the complex spectrum of said previous speech segment; align the position of the first pitch excitation of said current speech segment to the last pitch excitation of said previous speech segment; and apply a time shift and a complex Hilbert filter to said complex spectra. 